package com.projectx.action.chat.GroupAnnocement;

import android.content.Intent;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.projectx.R;
import com.projectx.action.chat.GroupChatActivity;
import com.projectx.util.ActivityManage;

public class AddAnnouncement extends AppCompatActivity {
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityManage.addActivity("AddAnnouncement",this);
        setContentView(R.layout.activity_changeannocement);
        try {
            getSupportActionBar().hide(); //去除标题栏
        } catch (NullPointerException e){
            Log.d("KMH","没有状态栏标题");
        }
        final ImageView back=findViewById(R.id.back);
        final Button change=findViewById(R.id.change);
        final EditText content=findViewById(R.id.content);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ActivityManage.exitActivity("AddAnnouncement");
            }
        });
        change.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(AddAnnouncement.this, GroupDialogActivity.class);
                intent.putExtra("change_content",content.getText().toString());
                startActivity(intent);
                ActivityManage.exitActivity("AddAnnouncement");
            }
        });
    }
}
